﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
using SkinnedModel;



namespace ObjectLibrary
{
    public class CatFighter : Fighter
    {
        public CatFighter(ContentManager content, string strName)
        {
            _model = new MySkinning3DModel(content, strName,0.3f,Vector3.Zero,0);
            //_model.TransformMatrix = Matrix.CreateScale(0.2f);

            _skinningData = _model.Model.Tag as SkinningData;

            if (_skinningData == null)
                throw new InvalidOperationException
                    ("This model does not contain a SkinningData tag.");

            // Create an animation player, and start decoding an animation clip.
            _animationPlayer = new AnimationPlayer(_skinningData);

            _speed = 0.25f;
            //Scale = 0.3f;

            Init();

            _firstMove = new Move();
            Move punch = new Move("Combo_1_01", "Combo_1_01re", Vector3.Zero, 0, 10,Move.Strike.PUNCH);
            Move kick;


            punch.NextPunchMove = new Move("Combo_1_02", "Combo_1_02re", Vector3.Zero, 0, 12, Move.Strike.PUNCH);
            _firstMove.NextPunchMove = punch;

            punch = punch.NextPunchMove;
            punch.NextPunchMove = new Move("Combo_1_03", "Combo_1_03re", new Vector3(0, 0, 1.5f), 0, 15, Move.Strike.PUNCH);
            punch.NextKickMove = new Move("Combo_1v1_03", "Combo_1v1_03re", new Vector3(0, 0, 0.4f), 0, 10, Move.Strike.KICK);

            kick = punch.NextKickMove;
            kick.NextKickMove = new Move("Combo_1v1_04", "Combo_1v1_04re", new Vector3(0, 0, 1.2f), 0, 25, Move.Strike.KICK);
            kick = kick.NextKickMove;
            kick.NextPunchMove = new Move("Combo_1v1_05", "Combo_1v1_05re", new Vector3(0, 0, 4.8f), 0, 50, Move.Strike.PUNCH);

            punch = punch.NextPunchMove;
            punch.NextPunchMove = new Move("Combo_1_04", "Combo_1_04re", new Vector3(0, 0, 2.0f), 0, 50, Move.Strike.PUNCH);

            kick = new Move("Combo_2_01", "Combo_2_01re", Vector3.Zero, 0, 10, Move.Strike.KICK);
            _firstMove.NextKickMove = kick;
            kick.NextKickMove = new Move("Combo_2_02", "Combo_2_02re", Vector3.Zero, 0, 10,Move.Strike.KICK);
            kick = kick.NextKickMove;
            kick.NextKickMove = new Move("Combo_2_03", "Combo_2_03re", new Vector3(-2.85f, 0, 2.6f), -0.55f, 70, Move.Strike.KICK);

            // Bounding Sphere
            //createCollisionXML("Content/" + strName + "Collision.xml");
            skinnedSpheres = content.Load<SkinnedSphere[]>(strName + "Collision");
            boundingSpheres = new BoundingSphere[skinnedSpheres.Length];
        }

        public override void Update(GameTime gameTime)
        {
            base.Update(gameTime);
        }

    }
}
